package hngc.com;

import java.util.Scanner;

public class Box3 {
    public static void main(String[] args) {
        int x = 0;
        int k = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入x的值");
        while (scanner.hasNext()) {
            try {
                x = scanner.nextInt();
                System.out.println("输入k的值");
                k = scanner.nextInt();
                break;
            } catch (Exception e) {
                System.out.println("输入不符合要求");
                return;
            }
        }
        if (x < 0 || k < 0) {
            System.out.println("输入不符合要求");
        } else if (0 < x && 30 >= x) {
            System.out.println("测试为算式一，值为：" + Math.sin(x));
        } else if (30 < x && 60 >= x) {
            System.out.println("测试为算式二，值为：" + Math.cos(Math.pow(x, k)));
        } else if (x > 60) {
            System.out.println("测试为算式三，值为：" + Math.tan(x / k));
        } else {
            System.out.println("输入不符合要求");
        }
        scanner.close();
    }
}
